package com.weixing.mall.provider.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.weixing.mall.provider.mapper.AgentRebateRuleInfoMapper;
import com.weixing.mall.provider.model.domain.AgentRebateRuleInfo;
import com.weixing.mall.provider.model.vo.RuleInfoVo;
import com.weixing.mall.provider.service.IAgentRebateRuleInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 促销模块-代理商活动返利规则配置详情表 服务实现类
 * </p>
 *
 * @author Small
 * @since 2019-11-16
 */
@Service
public class AgentRebateRuleInfoServiceImpl extends ServiceImpl<AgentRebateRuleInfoMapper, AgentRebateRuleInfo> implements IAgentRebateRuleInfoService {

    @Override
    public AgentRebateRuleInfo findByRuleIdAndRuleCode(Long agentRebateRuleId, int infoCode) {
        return getOne(new QueryWrapper<AgentRebateRuleInfo>().eq("rule_id",agentRebateRuleId).eq("info_code",infoCode));
    }

    @Override
    public List<RuleInfoVo> selectByRuleId(Long id) {
        return baseMapper.selectByRuleId(id);
    }
}
